package com.itheima.类加载与反射.反射.案例一;

import java.lang.reflect.Constructor;

public class 测试2 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class c = Class.forName("com.itheima.类加载与反射.反射.案例一.Student");
        Constructor[] cons = c.getConstructors();
        for (Constructor con : cons) {
            System.out.println(con);
        }
        System.out.println("===============");
        Constructor[] dcons = c.getDeclaredConstructors();
        for (Constructor dcon : dcons) {
            System.out.println(dcon);
        }
        System.out.println("===============");
        Constructor con = c.getConstructor(String.class, int.class);
        System.out.println(con);

        System.out.println("===============");
        Constructor dcon1 = c.getDeclaredConstructor(String.class, int.class);
        System.out.println(dcon1);
        Constructor dcon2 = c.getDeclaredConstructor();
        System.out.println(dcon2);
    }
}
